﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace DarkLordsApprenticeV2
{
    class StoryHelper : DrawableGameComponent
    {
        

        public StoryHelper(Game g, Vector2 position)
            : base(g)
        {
            Position = position;
            index = 0;
            frames = new Texture2D[5];
        }
        
        int index;
        Texture2D[] frames;
        Texture2D frame;
        SpriteBatch spriteBatch;
        public Vector2 Position { get; set; }
        
        protected override void LoadContent()
        {
            frames[0] = Game.Content.Load<Texture2D>("IntroScreen");
            frames[1] = Game.Content.Load<Texture2D>("StoryScreen");
            frames[2] = Game.Content.Load<Texture2D>("InstructionsScreen");
            frames[3] = Game.Content.Load<Texture2D>("GoodEnding");
            frames[4] = Game.Content.Load<Texture2D>("BadEnding");

            //frame = Game.Content.Load<Texture2D>("IntroScreen");

            spriteBatch = new SpriteBatch(Game.GraphicsDevice);
        }

        public override void Update(GameTime gameTime)
        {
        }

        public override void Draw(GameTime gameTime)
        {
            spriteBatch.Begin();
            //spriteBatch.Draw(frame, Position, Color.White);
            spriteBatch.Draw(frames[index], Position, Color.White);
            spriteBatch.End();
        }

        public void SwitchToIntro()
        {
            index = 0;
        }

        public void SwitchToStory()
        {
            index = 1;
        }

        public void SwitchToInstructions()
        {
            index = 2;
        }

        public void SwitchToGoodEnding()
        {
            index = 3;
        }

        public void SwitchToBadEnding()
        {
            index = 4;
        }
    }
}
